<#if ctrl.getPortletType() != 'CONTAINER'>
<#ibizinclude>../@MACRO/CONTROL/LANGBASE.vue.ftl</#ibizinclude>
<#macro renderUiaction>
  <#if ctrl.getPSUIActionGroup?? && ctrl.getPSUIActionGroup()?? && ctrl.getPSUIActionGroup().getPSUIActionGroupDetails()??>
    <#assign UIActionDetails=ctrl.getPSUIActionGroup().getPSUIActionGroupDetails() />
<span class="portlet-action">
    <#list UIActionDetails as uiactiondetail>
      <#if !uiactiondetail.isShowCaption()>
  <tooltip :transfer="true" :max-width="600">
      </#if>
      <#if uiactiondetail.getPSUIAction?? && uiactiondetail.getPSUIAction()?? && uiactiondetail.getPSUIAction().getCodeName?? && uiactiondetail.getPSUIAction().getCodeName()??>
        <#assign uiactionname = uiactiondetail.getPSUIAction().getCodeName()?lower_case />
      <#else>
        <#assign uiactionname = uiactiondetail.getName()?lower_case />
      </#if>
    <a @click="uiAction('${uiactiondetail.getName()?lower_case}', $event)" v-show="uiactionModel['${uiactionname}'].visabled" :disabled="uiactionModel['${uiactionname}'].disabled">
      <#if uiactiondetail.getPSUIAction()??>
        <#if uiactiondetail.isShowIcon()>
          <#if uiactiondetail.getPSUIAction().getPSSysImage()??>
            <#assign viewimg=uiactiondetail.getPSUIAction().getPSSysImage()/>
            <#if viewimg.getCssClass() != ''>
      <i class="${viewimg.getCssClass()}" />
            <#else>
      <img src="${viewimg.getImagePath()}" />
            </#if>
          </#if>
        </#if>
    <#--  <#if uiactiondetail.isShowCaption()><span><#if langbase??>{{$t('${langbase}.uiactions.${uiactiondetail.getPSUIAction().getUIActionTag()?lower_case}')}}<#else>${uiactiondetail.getPSUIAction().getCaption()}</#if></span></#if>  -->
        <#if uiactiondetail.isShowCaption()>
      <span>${uiactiondetail.getPSUIAction().getCaption()}</span>
        </#if>
      </#if>
    </a>
      <#if !uiactiondetail.isShowCaption()>
    <div slot='content'>${uiactiondetail.getPSUIAction().getCaption()}</div>
  </tooltip>
      </#if>
    </#list>
</span>
  </#if>
</#macro>
<div class='portlet ${srffilepath2(ctrl.getCodeName())} <#if ctrl.getPSSysCss()??> ${ctrl.getPSSysCss().getCssName()}</#if>' :style="{<#if (ctrl.getHeight?? && ctrl.getHeight() gt 0)>'height': isAdaptiveSize ? '100%' : getHeight,</#if><#if (ctrl.getWidth?? && ctrl.getWidth() gt 0)>'width': isAdaptiveSize ? '100%' : (width ? width+'px' :'${ctrl.getWidth()?c}px')</#if>}">
    <#if ctrl.getPortletType?? && ctrl.getPortletType()??><#t>
      <#--  视图  -->
      <#if ctrl.getPortletType() == 'VIEW' && ctrl.getPortletPSAppView?? && ctrl.getPortletPSAppView()??><#t>
        <#if ctrl.isShowTitleBar() && ctrl.getTitle()??>
        <p class='portlet-title'>
            <span>
            <#if ctrl.getPSSysImage()??><i class='<#assign img=ctrl.getPSSysImage()><#if img.getCssClass()?? && (img.getCssClass()?length gt 0)>${img.getCssClass()}</#if>'></i></#if>
            ${ctrl.getTitle()}
            </span>
            <#assign render_uiaction><@renderUiaction /></#assign>
            <@ibizindent blank=12>
            ${render_uiaction}<#t>
            </@ibizindent>
        </p>
        </#if>
        <div class="<#if ctrl.isShowTitleBar()>portlet-with-title<#else>portlet-without-title</#if>">
        <#assign refview = ctrl.getPortletPSAppView()><#t>
        <${srffilepath2(refview.getCodeName())} :portletState="viewState" :viewUsage="4" :viewdata="JSON.stringify(context)" :viewDefaultUsage="false" ></${srffilepath2(refview.getCodeName())}>
        </div>
      <#--  菜单  -->
      <#elseif  ctrl.getPortletType() == 'APPMENU'><#t>
        <#if ctrl.isShowTitleBar() && ctrl.getTitle()??>
        <p class='portlet-title'>
            <span>
            <#if ctrl.getPSSysImage()??><i class='<#assign img=ctrl.getPSSysImage()><#if img.getCssClass()?? && (img.getCssClass()?length gt 0)>${img.getCssClass()}</#if>'></i></#if>
            ${ctrl.getTitle()}
            </span>
            <#assign render_uiaction><@renderUiaction /></#assign>
            <@ibizindent blank=12>
            ${render_uiaction}<#t>
            </@ibizindent>
        </p>
        </#if>
        <div class="<#if ctrl.isShowTitleBar()>portlet-with-title<#else>portlet-without-title</#if>">
        <#assign appmenu = ctrl.getPSAppMenu()><#t>
        <@ibizindent blank=6>
        ${P.getCtrlCode(appmenu, 'CONTROL.html').code}
        </@ibizindent>
        </div>
      <#--  自定义  -->
      <#elseif  ctrl.getPortletType() == 'CUSTOM'>
        <#if ctrl.isShowTitleBar() && ctrl.getTitle()??>
        <p class='portlet-title'>
            <span>
            <#if ctrl.getPSSysImage()??><i class='<#assign img=ctrl.getPSSysImage()><#if img.getCssClass()?? && (img.getCssClass()?length gt 0)>${img.getCssClass()}</#if>'></i></#if>
            ${ctrl.getTitle()}
            </span>
            <#assign render_uiaction><@renderUiaction /></#assign>
            <@ibizindent blank=12>
            ${render_uiaction}<#t>
            </@ibizindent>
        </p>
        </#if>
        <div class="<#if ctrl.isShowTitleBar()>portlet-with-title<#else>portlet-without-title</#if>">
        <#if ctrl.render??>
        ${ctrl.render.code}
        <#else>
        <div>{{$t('app.portlet.noExtensions')}}</div>
        </#if>
        </div>
      <#--  操作栏  -->
      <#elseif  ctrl.getPortletType() == 'ACTIONBAR'>
        <#if ctrl.isShowTitleBar() && ctrl.getTitle()??>
        <p class='portlet-title'>
            <span>
            <#if ctrl.getPSSysImage()??><i class='<#assign img=ctrl.getPSSysImage()><#if img.getCssClass()?? && (img.getCssClass()?length gt 0)>${img.getCssClass()}</#if>'></i></#if>
            ${ctrl.getTitle()}
            </span>
        </p>
        </#if>
        <div class="<#if ctrl.isShowTitleBar()>portlet-with-title<#else>portlet-without-title</#if>">
        <#if ctrl.render??>
            ${ctrl.render.code}
        <#else>
            <app-actionbar :viewState="viewState" :uiService="appUIService" :items="actionBarModelData" @itemClick="handleItemClick($event)"></app-actionbar>
        </#if>
        </div>
      <#--  HTML  -->
      <#elseif  ctrl.getPortletType() == 'HTML'>
        <#if ctrl.isShowTitleBar() && ctrl.getTitle()??>
        <p class='portlet-title'>
            <span>
            <#if ctrl.getPSSysImage()??><i class='<#assign img=ctrl.getPSSysImage()><#if img.getCssClass()?? && (img.getCssClass()?length gt 0)>${img.getCssClass()}</#if>'></i></#if>
            ${ctrl.getTitle()}
            </span>
            <#assign render_uiaction><@renderUiaction /></#assign>
            <@ibizindent blank=12>
            ${render_uiaction}<#t>
            </@ibizindent>
        </p>
        </#if>
        <div class="<#if ctrl.isShowTitleBar()>portlet-with-title<#else>portlet-without-title</#if>">
        <iframe src="<#if ctrl.getPageUrl()??>${ctrl.getPageUrl()}</#if>" style="height: <#if ctrl.getHeight() gt 0>${ctrl.getHeight()?c}<#else>400</#if>px;width: 100%;border-width: 1px;"></iframe>
        </div> 
      <#elseif  ctrl.getPortletType() == 'RAWITEM'>
        <#if ctrl.isShowTitleBar() && ctrl.getTitle()??>
        <p class='portlet-title'>
            <span>
            ${ctrl.getTitle()}
            </span>
        </p>
        <el-divider class="divider"></el-divider>
        </#if>
        <div class="<#if ctrl.isShowTitleBar()>portlet-with-title<#else>portlet-without-title</#if>">
        <#if ctrl.render??>
            ${ctrl.render.code}
        <#else>
            <app-rawitem
                :viewparams="viewparams" 
                :context="context"
                contentStyle="<#if ctrl.getPSSysCss()??>${ctrl.getPSSysCss().getCssName()}</#if>"
                sizeStyle="<#if ctrl.getRawItemHeight() gt 0>height: ${ctrl.getRawItemHeight()?c}px;</#if><#if ctrl.getRawItemWidth() gt 0>width: ${ctrl.getRawItemWidth()?c}px;</#if>"
                contentType="<#if ctrl.getContentType?? && ctrl.getContentType()??>${ctrl.getContentType()}</#if>"
                <#if ctrl.getHtmlContent?? && ctrl.getHtmlContent()??>
                :htmlContent='`${ctrl.getHtmlContent()}`'
                </#if>
                <#if ctrl.getPSSysImage?? && ctrl.getPSSysImage()??>
                <#assign img=ctrl.getPSSysImage()>
                <#if img.getCssClass()?? && (img.getCssClass()?length gt 0)>
                imageClass="${img.getCssClass()}"</#if></#if>>
                <#if ctrl.getContentType?? && ctrl.getContentType() == 'RAW'>
                  ${ctrl.getRawContent()}
                </#if>
            </app-rawitem>
        </#if>
        </div>         
      <#--  其他部件  -->
      <#elseif ctrl.getContentPSControl()??><#t>
        <#if ctrl.isShowTitleBar() && ctrl.getTitle()??>
        <p class='portlet-title'>
            <span>
            <#if ctrl.getPSSysImage()??><i class='<#assign img=ctrl.getPSSysImage()><#if img.getCssClass()?? && (img.getCssClass()?length gt 0)>${img.getCssClass()}</#if>'></i></#if>
            ${ctrl.getTitle()}
            </span>
            <#assign render_uiaction><@renderUiaction /></#assign>
            <@ibizindent blank=12>
            ${render_uiaction}<#t>
            </@ibizindent>
        </p>
        </#if>
        <div class="<#if ctrl.isShowTitleBar()>portlet-with-title<#else>portlet-without-title</#if>">
        <#assign control = ctrl.getContentPSControl()><#t>
        <!-- 测试 -->
        <@ibizindent blank=6>
        ${P.getCtrlCode(control, 'CONTROL.html').code}
        </@ibizindent>
        </div>
      </#if>
    </#if>
</div>
</#if>